package com.jibei.mendo.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.jibei.mendo.dao.StringConverter;

import org.greenrobot.greendao.annotation.Convert;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.util.List;

/**
 * Created by lhl on 2019/9/8.
 * 矩阵信息的bean
 */
@Entity
public class MatrixInfoBean implements Parcelable {

    @Id(autoincrement = true)
    private Long id;
    private String matrixId;//矩阵id
    @Convert(columnType = String.class, converter = StringConverter.class)
    private List<String> vidLists;//从机ids

    @Generated(hash = 1512472091)
    public MatrixInfoBean(Long id, String matrixId, List<String> vidLists) {
        this.id = id;
        this.matrixId = matrixId;
        this.vidLists = vidLists;
    }

    @Generated(hash = 158015173)
    public MatrixInfoBean() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMatrixId() {
        return this.matrixId;
    }

    public void setMatrixId(String matrixId) {
        this.matrixId = matrixId;
    }

    public List<String> getVidLists() {
        return this.vidLists;
    }

    public void setVidLists(List<String> vidLists) {
        this.vidLists = vidLists;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.matrixId);
        dest.writeStringList(this.vidLists);
    }

    protected MatrixInfoBean(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.matrixId = in.readString();
        this.vidLists = in.createStringArrayList();
    }

    public static final Creator<MatrixInfoBean> CREATOR = new Creator<MatrixInfoBean>() {
        @Override
        public MatrixInfoBean createFromParcel(Parcel source) {
            return new MatrixInfoBean(source);
        }

        @Override
        public MatrixInfoBean[] newArray(int size) {
            return new MatrixInfoBean[size];
        }
    };

    @Override
    public String toString() {
        return "MatrixInfoBean{" +
                "id=" + id +
                ", matrixId='" + matrixId + '\'' +
                ", vidLists=" + vidLists +
                '}';
    }
}
